package com.filldream.fastboot.common.constant;

/**
 * @author RickSun
 * @Description Pattern正则表达式
 **/
public class PatternEx {

    //e-mail
    public static final String email =  "\\w+(\\.\\w)*@\\w+(\\.\\w{2,3}){1,3}";

    //手机号,注意号码段的更新
    public static final String telephone = "^1(3[0-9]|4[01456879]|5[0-3,5-9]|6[2567]|7[0-8]|8[0-9]|9[0-3,5-9])\\d{8}$";

    //中文
    public static final String chinese = "^[\u4e00-\u9fa5]+";

    //IP地址
    public static final String ip = "^((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]|[*])\\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5]|[*])$";

    //验证HTTP开头的URL,且验证带参的网址
    public static final String httpUrl = "^([hH][tT]{2}[pP]:/*|[hH][tT]{2}[pP][sS]:/*|[fF][tT][pP]:/*)(([A-Za-z0-9-~]+).)+([A-Za-z0-9-~\\/])+(\\?{0,1}(([A-Za-z0-9-~]+\\={0,1})([A-Za-z0-9-~]*)\\&{0,1})*)$";

    //纯数字
    public static final String pureNumber = "[0-9]+";

    //正负纯数字
    public static final String number = "^[+-]?[0-9]+$";

    //是否小数
    public static final String decimal = "^-?([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0)$";

    //纯英文字母
    public static final String alphabet = "[a-zA-Z]+";

    //校验三十二位的字符串
    public static final String str32 = "^.{32,32}$";

    /** 颜色 */
    private static final String V_COLOR = "^[a-fA-F0-9]{6}$";

    /** 颜色：#F28939 */
    public static final String V_COLOR2 = "^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$";

    /** 逗号隔开的字符串 **/
    public static final String commaSplit = "^,([0-9]+,)+$";


}
